#!/bin/sh

#APP_ZH_NAME   $1
#APP_EN_NAME   $2
#HOST          $3
#UPDATE_HOST   $4
#APP_VERSION   $5
#CLIENT_ID     $6
#CLIENT_SECRET $7
#Copyright     $8
#CFBundleIdentifier $9
#CFBundleShortVersionString
#CFBundleVersion

if [ "$1" == "" ] || [ "$2" == "" ];then
show_help_and_exit
fi


#修改国际化
if [ -f "zh-Hans.lproj/InfoPlist.strings" ];
then
sed -i "" 's/国际化App名称/'"$1"'/g' en.lproj/InfoPlist.strings
else
echo "InfoPlist.strings not find"
fi

if [ -f "en.lproj/InfoPlist.strings" ];
then
sed -i "" 's/Localizable App Name/'"$2"'/g' en.lproj/InfoPlist.strings
else
echo "InfoPlist.strings not find"
fi

#修改CFBundleIdentifier
/usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier ""$2" Info.plist
#修改CFBundleShortVersionString
/usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier ""$2" Info.plist
#com.aabbcc.JenkinsTest
